// import { message } from 'antd';
import { Redirect } from 'umi';

export default (props: any) => {
  const isLogin = localStorage.getItem('token') ? true : false;
  if (isLogin) {
    return <div>{props.children}</div>;
  } else {
    // message.warning('请先登录');
    return <Redirect to="/login" />;
  }
};
